home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / programs / vbbs542.zip / VSCRIPT.DOC < prev    next >
Text File  |  1992-02-12  |  32KB  |  1,010 lines

  1.  
  2.                      The Vscript script language
  3.                     =-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4.  
  5. The script languange itself has some similarities to REXX. A script
  6. is composed of lines of pure ASCII text that can be written using
  7. just about any word processor in ASCII mode.
  8.  
  9. A few features of the language are:
  10.  
  11. -Scalar variables which can be used for storing numbers, strings, characters
  12. -Numeric and String operators
  13. -Commands supporting various types of serial input and output
  14. -Built-in database/data buffer commands
  15. -User account modify sysop-defined fields commands
  16. -Commands which provide functions for a multi-user system
  17. -Transfer control, subroutine, relational testing/branching
  18. -Chain execution to another script
  19. -Definable Break processing
  20. -SHELL to DOS capability
  21. -Compiled Script Language (Loads and Executes Faster!)
  22. -FINDFIRST and FINDNEXT commands for searching DOS directories
  23. -Automatic ANSI control
  24. -Up to 20 time-programmed events per day
  25. -VBBS releases all RAM before running DOORS and Events, freeing up more
  26. space for your other programs and multitasking.
  27.  
  28.  
  29.  
  30.         A simple excersize in modifying a script might begin in Start.V
  31. with a customized new user letter from the SysOp. Where you see "We hope
  32. you find your stay here enjoyable", you will notice that it is preceded
  33. by a BUFFER APPEND command. Using the same structure you may easily add
  34. additional lines to the letter. Once you have done this, you simply type
  35. Vcom start.v and your modified script will be compiled. You may go
  36. through the scripts and change lines of text, add or change colors though
  37. the the use of color commands ($blue, $green $magenta etc), and just
  38. experiment. Note that the ! character is the comment character and
  39. anything following ! within the script will be ignored.
  40.  
  41.  
  42.  
  43.                             The SCRIPT Language
  44.                            ~~~~~~~~~~~~~~~~~~~~~
  45. VBBS comes with a COMPLETE set of scripts -- you can set up and run your
  46. new VBBS in a matter of minutes. The script language is a very powerful part
  47. of VBBS that gives it truly amazing flexibility. It is easy to
  48. included scripts (and design new ones ), a thorough
  49. explanation follows.
  50.  
  51. First off, a script is nothing more than an ASCII text file containing your
  52. commands, one per line. When your script is compiled, parsed ("tokenized")
  53. and coded into a binary form which loads and executes much faster. When it
  54. is executed, the coded form is loaded entirely into memory.
  55. The definition of a TOKEN under VBBS is very important. The commands
  56. use these tokens are their parameters.
  57.  
  58. A token is defined as:
  59. 1. Any unspaced string of characters,
  60. or
  61. 2. Any string surrounded either by single quotes or double quotes.
  62.    (So that you can embed spaces in strings.)
  63.    Of course, the outside quotes are NOT actually a part of the string.
  64.  
  65. (This definition of a token is very similar to that for REXX.)
  66.  
  67. As you can surmise from the definition, spaces are used to delimit words,
  68. with quotes as an over-ride.
  69.  
  70. Up to seven tokens may be specified per line. With the exception of
  71. the assignment statement, the first token in the line must be a script
  72. command. Tokens may be either string literals or script variables.
  73. The VBBS script language is NOT CASE-SENSITIVE. (Capitalization used in
  74. this text is not required and is done only for clarity.)
  75.  
  76. Scalar variables in the VBBS script language begin with a $ character. All
  77. variable data is stored as string data, even numeric data. Numeric data is,
  78. however, temporarily converted to binary single-precision form for computations.
  79.  
  80. Assignment to variables is done with the = character. For example:
  81.  
  82.    $test = 1             {Loads the string '1' into the variable $test}
  83.    $test = "1"           {Exactly equivalent to $test = 1}
  84.    $greeting = "Hello"   {Sets variable $greeting to 'Hello'}
  85.  
  86. There are several numeric and string operators. You may only use operators
  87. in assignment statements, and you may do up to two operations per line
  88. (because of the 7 token per line maximum).
  89.  
  90. + Addition
  91. - Subtraction
  92. * Multiplication
  93. / Division
  94.  
  95.    $test = $value * 10       {Multiplies the contents of $value by 10
  96.                               and stores the result in $test}
  97.    $test = $value - $loss    {Subtracts the value of $loss from $value
  98.                            and stores the result in $test}
  99.    $test = $count - 1 * 100  {Takes value of $count, subtracts 1, then
  100.                               multiplies by 100 and stores the result in
  101.                               $test}
  102.  
  103. & String Concatenation
  104.  
  105.    $test = "Welcome Back, " & $name
  106.  
  107. In addition to above, there are a few of built-in functions.
  108. Syntactically, though, they look more like operators. Actually, the
  109. way they were implemented is "Quite Illogical, Captain."
  110. But it was done this way for speed, and it works!
  111.  
  112. INT Chops off the fractional part of a number.
  113.  
  114.    $test = $value INT 0      {Takes the value of $value, chops the fractional
  115.                               part and stores the result in $test. The 0 is a
  116.                               dummy placeholder, and is REQUIRED}
  117.  
  118. RND Generates Psuedo-random numbers in a specified range.
  119.  
  120.    $random = 1 RND 10  {Generates a random number between 1 and 10, inclusive}
  121.  
  122. UPPER Returns the upper-case equivalent of a string.
  123.  
  124.    $test = "abc" UPPER 0 {Converts abc to upper-case, puts the result in $test
  125.                           Note the dummy 0 placeholder}
  126.  
  127. ASC Returns the ASCII code of the first character in the string.
  128.  
  129.    $test = $string ASC 0 {Computes the ASCII code of the first character
  130.                           of the contents of $string, stores in $test}
  131.  
  132. CHR Returns the corresponding string character, given the ASCII code.
  133.  
  134.    $test = $code CHR 0
  135.  
  136. INSTR Scans a string for a given substring. Returns 0 if not found.
  137.       Returns position of substring otherwise.
  138.  
  139.    $position = $mainstring INSTR $substring
  140.  
  141. LEN Returns the length of a string.
  142.  
  143.    $length = $string LEN 0
  144.    $length = "hello" LEN 0
  145.  
  146. LEFT Returns the leftmost number of specified characters.
  147.  
  148.    $leftpart = $string LEFT 4   {Returns leftmost 4 characters of contents
  149.                                  of $string}
  150.  
  151. MID Returns a substring from the middle of a string to the end.
  152.  
  153.    $midpart = $string MID 5     {Returns all characters from position 5
  154.                                  to the end of the contents of $string}
  155.  
  156.    $extract = "123456789" MID 3 LEFT 4 {In this example, two operations are
  157.                     performed. First, the MID is done, returning 3456789. Then
  158.                         LEFT is applied returning 3456, the final result.}
  159.  
  160. SQR Returns the square root of a value.
  161.  
  162.    $root = $value SQR 0
  163.  
  164.                                   ==*==
  165.  
  166.                          Display/Serial I/O Commands
  167.                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  168.  
  169. RS <variable> <prompt>
  170.  
  171.   Transmits optional prompt and reads a line of input into a variable. Input
  172.   is echoed character by character, and terminates with a carriage return.
  173.   The length parameter limits to the length of the input line.
  174.   RS $name "What is your Name?"
  175.  
  176. RX <variable> <prompt>
  177.  
  178.   Transmits optional prompt and reads a line of input into a variable.
  179.   X's are echoed as characters are input. Input terminates with a
  180.   carriage return.
  181.   RX $newpassword "What is your new password?"
  182.  
  183. RW <variable> <prompt>
  184.  
  185.   Transmits optional prompt and reads a line of input into a variable.
  186.   Input is echoed character by character, and WORD-WRAP is taken care of
  187.   automatically. Input terminates with a carriage return, or when the
  188.   line limit is reached. In the case of the line limit, the "broken" word
  189.   on the end is removed from the string and stored internally for the next
  190.   use of RW and the remaining line is stored in the script variable.
  191.   Use RW as the input command for message and text editors.
  192.   RW $line ">"
  193.  
  194. RN <variable> <prompt>
  195.  
  196.   RN is a lot like RS except it should be used to read numeric input.
  197.   RN will not allow bad characters or too many digits to be input.
  198.  
  199. RF <variable> <prompt>
  200.  
  201.   RF is similar to RS execpt it should be used to get filename input.
  202.   It will not allow a user to enter an invalid filename.
  203.  
  204. RC <variable> <prompt>
  205.  
  206.   Transmits optional prompt and waits for the user to press a key.
  207.   The key is stored in the variable, but is not echoed.
  208.   RC $char "Your Command? "
  209.  
  210. RR <variable> <restricted character list> <prompt>
  211.  
  212.   Transmits an optional prompt and waits for the user to press a key.
  213.   Keys not in the "restricted character list" are ignored.
  214.   The keystroke is not echoed. Not case-sensitive.
  215.   RR $key ABCD "Select: A, B, C, or D. "
  216.  
  217. RL <variable> <restricted character list> <numeric limit> <prompt>
  218.  
  219.   RR works with a restricted character list. RL uses a restricted character
  220.   list and a numeric range in forming user input. The low end of the rnage
  221.   is always 1. The high end of the range is the <numeric limit>.
  222.   For example:
  223.   RL $var Q 20 "Please Select 1-20, Q to Quit:"
  224.   Allows input of character Q or number between 1 and 20.
  225.   RL is very flexible and very handy. For more exmaple of use, see the
  226.   scripts.
  227.  
  228. RI <variable> <prompt>
  229.  
  230.   Much like RF, except it allows wildcard filenames.
  231.  
  232. TR <token 1> <token 2> ... <token 6>
  233.  
  234.   Automatically concatenates all of the tokens you specify
  235.   (both contents of variables and literals) and transmits the string
  236.   with a Carriage Return and Linefeed appended.
  237.  
  238.   TR "Welcome back to the BBS!"
  239.   TR "Hello " $name ", how are you doing today?"
  240.  
  241.   Additionally, optional output formatters can be used to make your numeric
  242.   and string variables print neatly.
  243.  
  244.   TR %s20 $s <= Variable $s, left justifies, pads to 20 length
  245.   TR %i4 $i  <= Variable $i, formatted to a 4 digit integer.
  246.   TR %d3.2 $d <= Variable $d, formatted to a decimal with form ###.##
  247.  
  248. TS <token 1> <token 2> ... <token 6>
  249.  
  250.   Same as TR except no Carraige Return/Linefeed is appended.
  251.  
  252. PAUSE <optional prompt string>
  253.  
  254.   If no string is specified, uses the default set-up by VCONFIG.EXE.
  255.   Transmits the prompt, waits for any key, then back-spaces over the prompt.
  256.  
  257.                                 ==*==
  258.  
  259.  
  260.                              Database Commands
  261.                             ~~~~~~~~~~~~~~~~~~~
  262.  
  263. DBGROUP <group identifier>
  264.  
  265.   Before you can execute the DB command, below, you must select a
  266.   database group. Grouping was implemented so that it would be much
  267.   easier to implement global functions and so that databases may be added
  268.   and deleted (using VCONFIG.EXE) without the need to edit the scripts
  269.   every time. The <group identifier> is a single identification character.
  270.   A to Z recommended.
  271.  
  272.   When you execute a DBGROUP command, the special variable $DBNUMBER
  273.   is loaded. It contains the number of databases in the group. The first
  274.   database in any group is number 1. This makes it easy for a script
  275.   to do global operations by using these lower and upper limits in a loop.
  276.  
  277.   The special variable $DBGROUP is loaded with the group id. Since LINK
  278.   clears normal variables, $DBGROUP could be used to pass group select
  279.   information to another script.
  280.  
  281.   How you group your databases is up to you. An example might be:
  282.   A for public message bases
  283.   F for public file bases
  284.   O for other databases (custom, imaginative database uses...)
  285.  
  286. DB <database #>
  287.  
  288.   The DB commands sets the current database for use. You must select a
  289.   database using this command somewhere in your script before any of the
  290.   other database commands (except DBGROUP) are used. Once you set the
  291.   database, it stay's set until another DB command is executed. Also, the
  292.   database must have been defined previously using VCONFIG.EXE.
  293.  
  294.   When a DB command is executed, "special" read-only variables
  295.   are automatically loaded:
  296.  
  297.   $DB     - The <database #> you specified. Use for passing this info to
  298.             other scripts when using the LINK command.
  299.   $DBNAME - The long name of the database.
  300.   $DBPATH - The path where database is located.
  301.   $DBFILE - The database filename.
  302.   $HIGHDB - This is the user's highest-database-entry-read quick-scan pointer.
  303.   $NUMBERDB - Number of entries in the database.
  304.   $WRITESL  - The database's write security level.
  305.  
  306. LOAD <entry number> <option>
  307.  
  308.   This command loads a database entry into special variables:
  309.  
  310.   $FROM     - The handle of the person who created the entry.
  311.   $FROMNO   - The User # of the person who created the entry.
  312.   $FROMNODE - VirtualNET node number of sender.
  313.   $TO       - The handle of the addressee, if any.
  314.   $TONO     - The User # of the addressee. 0 if to ALL.
  315.   $TONODE   - VirtualNET node number of addressee.
  316.   $SUBJECT  - The subject of the message, or brief description for a file.
  317.   $ORIGIN   - Origin - Optional - Use for BBS Tag Line, etc.
  318.   $ATTFILE  - Filename of 'attached' file, if any. Useful for DOWNLOAD command.
  319.   $SIZE     - Size of attached file. If no file, set to 0.
  320.   $DBFLAG   - Use is optional. Can be used as a message received flag
  321.               or any other desired purpose.
  322.   $DBCOUNT  - Use is optional. Can be used to count replies or
  323.               # of downloads, or any other desired purpose.
  324.   $DBTIME   - Creation time of entry.
  325.   $DBDATE   - Creation date of entry.
  326.  
  327.   Plus an additional variable called $RESULT. This is the result of
  328.   the LOAD operation. Returns:
  329.  
  330.   DEL if entry is marked as deleted,
  331.   OUT if entry number is out of range,
  332.   PRI if PRIVATE database, and user is not sender, addressee, or
  333.       SYSOP/Co-SYSOP (access with security level 250 or greater),
  334.   OK  otherwise.
  335.  
  336.   In addition to loading the special variables, LOAD also transfers
  337.   the memo file contents for the entry to the BUFFER and updates the
  338.   user's quick-scan pointer, unless you specify /Q for <option>.
  339.  
  340.   A typical use of the LOAD command to read messages might go like this:
  341.  
  342.   Use LOAD to load the entry (do NOT specify /Q option>
  343.   Test $RESULT
  344.   If OK, then use TR command to transmit the header data however you desire,
  345.               and use BUFFER LIST to display the memo line data.
  346.  
  347.   A typical use of the LOAD command to scan message titles might go like this:
  348.  
  349.   Use LOAD to load the entry specifying the /Q option
  350.   Test $RESULT
  351.   If OK, then use TR command to transmit the header data however you desire.
  352.  
  353. DEL <entry number>
  354.  
  355.   Marks an entry for deletion. This command, also, returns a result
  356.   in the special variable $RESULT. Returns:
  357.  
  358.   OUT if entry number is out of range,
  359.   PRI if the user is not sender, addressee, or SYSOP/Co-SYSOP.
  360.   OK  otherwise.
  361.  
  362. PACK
  363.  
  364.   Pack removes records which have been marked for deletion, and re-sequences
  365.   the database. It also updates user and network quickscan pointers.
  366.  
  367. ADDCOUNT <entry number>
  368.  
  369.   Adds 1 to the $DBCOUNT field of the entry number specified.
  370.  
  371. DBFLAG <entry number> <switch>
  372.  
  373.   Sets or Resets the $DBFLAG field of the entry number specified.
  374.   <switch> is either ON or OFF.
  375.  
  376. SEARCH <entry number> <key> <string>
  377.  
  378.   Searches the database, starting at the entry number specified.
  379.   <key> is either:
  380.         1 - Search TO field
  381.         2 - Search FROM field
  382.         3 - Search SUBJECT field
  383.         4 - Search FILENAME field (wildcards allowed)
  384.         5 - Search FILENAME field (wildcards not allowed)
  385.  
  386.   If <key> is 3, 4, or 5, then <string> is data to search for in field.
  387.  
  388.   SEARCH returns two results:
  389.   In $RESULT, OUT if not found,
  390.               OK otherwise.
  391.   In $SEARCH, the entry number where the search data was found.
  392.  
  393. QS <entry number>
  394.  
  395.   Manually change the user's quick-scan pointer to the entry number specified.
  396.  
  397. SAVE <to user #> <subject> <origin> <size> <attached filename> <to node #>
  398.  
  399.   Saves a database entry:
  400.     Header Information (the parameters on the line with SAVE).
  401.     Saves Memo Lines (the current contents of the BUFFER).
  402.  
  403.   <to user #> User # of addressee. If TO ALL, use 0.
  404.   <subject>   Data for subject field.
  405.   <origin>    Data for origin field.
  406.   <size>      Size of attach file, if any. Use 0 if none.
  407.   <attached filename> Filename of attached file, if any.
  408.   <to node #> VirtualNET Node # of addressee.
  409.  
  410.   The new entry header info is saved at the end of the current database file.
  411.   The BUFFER part is saved in a binary file and indexed (for speed).
  412.  
  413.  
  414.                                  ==*==
  415.                            File Transfer Commands
  416.                           ~~~~~~~~~~~~~~~~~~~~~~~~
  417. **   Note: To use the file transfer commands, you must have DSZ.COM, an    **
  418. ** external protocol driver. DSZ version 04-11-90 or newer is recommended! **
  419.  
  420. DOWNLOAD <path\filename>
  421.  
  422.   Prompt user for desired protocol (as they have been set up using VCONFIG)
  423.   and then sends a file to the user. You may include a full path specification
  424.   along with the filename.
  425.  
  426. UPLOAD <path\filename>     
  427.  
  428.   Just like DOWNLOAD except receives a file from a user.
  429.  
  430. BATCH
  431.  
  432.   Brings up the batch functions handling routine.
  433.  
  434. REMOTEUPLOAD
  435.  
  436.   Allows user to upload one or more files to the SysOp Review Directory.
  437.  
  438. LISTFILES
  439.  
  440.   Prompts for a file mask (can include wildcards), and lists all files
  441.   in the current selected (DB) database.
  442.  
  443. SEARCHALL
  444.  
  445.   Prompts for a file mask (can include wildcards), and lists all files.
  446.  
  447. NEWFILES
  448.  
  449.   Lists all NEW files, all databases in the current DBGROUP.
  450.  
  451. FINDFILES
  452.  
  453.   Searches the description, all databases in the current DBGROUP.
  454.  
  455. SYSOPUPLOAD
  456.  
  457.   Local SysOp Upload.
  458.  
  459. REVIEWUPLOADS
  460.  
  461.   Allows Sysop to Review new uploads.
  462.  
  463. REVIEWFILE
  464.  
  465.   Review/download files sequentially by file number.
  466.  
  467. DOWNLOADFILE
  468.  
  469.   Review/download files by wildcard filename mask.
  470.  
  471. RATIO
  472.  
  473.   Displays User Ratio.
  474.  
  475. TOPDOWNLOADS
  476.  
  477.   Display List of Most Popular Downloads.
  478.  
  479.                                    ==*==
  480.  
  481.                       High Level Communications Functions
  482.                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  483.  
  484. SENDEMAIL
  485.  
  486.   Send Email to another User.
  487.  
  488. FEEDBACK
  489.  
  490.   Send Email to the SysOp.
  491.  
  492. READEMAILTO
  493.  
  494.   Read all Email to User.
  495.  
  496. READEMAILFROM
  497.  
  498.   Read all email from User.
  499.  
  500. READALLEMAIL
  501.  
  502.   SysOp read all mail on system.
  503.  
  504. SETQUICKSCAN
  505.  
  506.   Set database in current DBGROUP join/ignore during newscan.
  507.  
  508. LISTBASES
  509.  
  510.   Lists the databases in the current DBGROUP.
  511.  
  512. SELECTBASE
  513.  
  514.   Select a database from the current DBGROUP.
  515.  
  516. PREVBASE
  517.  
  518.   Switch to the previous database.
  519.  
  520. NEXTBASE
  521.  
  522.   Switch to the next database.
  523.  
  524. READSEQMSG
  525.  
  526.   Read messages, sequentially.
  527.  
  528. READNEWMSG
  529.  
  530.   Read new messages in all selected databases.
  531.  
  532. SCANMSG
  533.  
  534.   Scan the current database.
  535.  
  536. POST
  537.  
  538.   Write a message in the current database.
  539.  
  540. QUICKMAIL
  541.  
  542.   Use the MultiMail Functions.
  543.  
  544.                                    ==*==
  545.  
  546.                                BUFFER Commands
  547.                               ~~~~~~~~~~~~~~~~~
  548.  
  549. BUFFER CLEAR
  550.  
  551.   Clears out the BUFFER.
  552.  
  553. BUFFER APPEND <text>
  554.  
  555.   Appends the line of text to the BUFFER.
  556.  
  557. BUFFER LIST
  558.  
  559.   Transmits the current contents of the buffer.
  560.   Strips ANSI from the buffer if the online user's ANSI preference is
  561.   turned off.
  562.  
  563. BUFFER CHANGE <old text> <new text>
  564.  
  565.   Global change <old text> in the BUFFER to <new text>.
  566.  
  567. BUFFER EDIT
  568.  
  569.   Starts up the built in line editor.
  570.  
  571. BUFFER FULLEDIT
  572.  
  573.   Starts up the built full screen editor.
  574.  
  575. BUFFER SAVE <filename>
  576.  
  577.   Saves the contents of the buffer into a sequential file.
  578.  
  579. BUFFER LOAD <filename>
  580.  
  581.   Loads the buffer from a sequential (text) file.
  582.  
  583. BUFFER QUOTE
  584.  
  585.   Sort of like BUFFER CLEAR, but allows user to "quote" up to 20 lines
  586.   from the previous post (which are still in the buffer). After the lines
  587.   have been selected by the user, they are saved in a temporary space.
  588.   the BUFEFR is CLEARed, and the quoted lines are put back into the beginning
  589.   of the buffer, preceeded by a >.
  590.  
  591.                                ==*==
  592.  
  593.                          Other Main Functions
  594.                          ~~~~~~~~~~~~~~~~~~~~
  595.  
  596. TEXTFILES
  597.  
  598.   Brings up the text files (bulletins) functions.
  599.  
  600. DOOR
  601.  
  602.          DOOR can be used with two different syntaxes:
  603.  
  604.          When used by itself, it brings up a list of DOOR programs
  605.          which can be run, as configured by VCONFIG, Doors
  606.          configuration. If a door is selected, the door info files
  607.          CHAIN.TXT, DORINFO1.DEF, and DOOR.SYS are written to disk.
  608.          Then the door is executed, with VBBS shrinking out.
  609.  
  610.          When used with a parameter, (as in DOOR "RUN-ME"),
  611.          the door info files are written, and the door is run
  612.          immediately.
  613.  
  614. AUTOPOST
  615.  
  616.   Brings up the autopost functions.
  617.  
  618. EDITFILE
  619.  
  620.   Allows Sysop to edit a text file. (200 line limit)
  621.  
  622. SYSINFO
  623.  
  624.   Displays the systsem information screen.
  625.  
  626. CLEANUP
  627.  
  628.   Packs all of the databases.
  629.  
  630. VOTE
  631.  
  632.   Brings up the voting booth functions.
  633.  
  634. CHECKVOTE
  635.  
  636.   Tells user if new polls exist, and takes them to the voting booth if so.
  637.  
  638. RANDOM
  639.  
  640.   Pulls up a random blurb from your random blurbs files and displays it.
  641.  
  642. ACCOUNT
  643.  
  644.   Brings up the account defaults set-up and allws the user to change them.
  645.  
  646. LISTNET
  647.  
  648.   Brings up the network listings functions.
  649.  
  650.                                ==*==
  651.  
  652.                            Sequential File I/O
  653.                           ~~~~~~~~~~~~~~~~~~~~~
  654.  
  655.  
  656. OPEN <filename> <access>
  657.  
  658.   <access> is INPUT, OUTPUT, or APPEND.
  659.  
  660. CLOSE
  661.  
  662.   Closes file previous opened with OPEN.
  663.  
  664. READ <var>
  665.  
  666.   Reads a line of input text from the file.
  667.   Returns !EOF! if the end of file has been reached.
  668.  
  669. WRITE <token1> <token2> ... <token7>
  670.  
  671.   Writes a line of text to the file.
  672.  
  673.                                  ==*==
  674.  
  675.                              Mutli-User Support
  676.                             ~~~~~~~~~~~~~~~~~~~~
  677.  
  678.  
  679. WHO
  680.  
  681.   Who else is on-line? Lists port #, user #, handle, current BBS activity.
  682.  
  683. ACTION <text>
  684.  
  685.   Sets the user's current BBS activity for the WHO command.
  686.  
  687. TELECON
  688.  
  689.   Enter the VBBS Teleconference Mode.
  690.  
  691.                                ==*==
  692.                          Transfer/Control Commands
  693.                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  694. # <label>
  695.  
  696.   Defines a label line.
  697.  
  698. GO <label>
  699.  
  700.   Go to the label specified.
  701.  
  702. CALL <label>
  703.  
  704.   Call a subroutine located at <label>.
  705.  
  706. RET
  707.  
  708.   Return from a CALL command.
  709.  
  710. EXIT <Function Block Name>
  711.  
  712.   Exit the current script and begin the function block specified.
  713.   (If none specified, EXIT returns you to the function block most
  714.   recently used. However, if the script SHRINKS OUT for any reason,
  715.   (DOOR command, etc), the function block name MUST be specified.)
  716.  
  717. TEST <token1> <relation> <token2> <label>
  718.  
  719.   Perform a non-case-sensitive string comparison and go to <label> if true.
  720.   <token1> and <token2> may be either variables or constants.
  721.   <relation> is one of the following:
  722.   <> Not equal
  723.   =  Equal
  724.   <= Less than or equal
  725.   >= Greater than or equal
  726.   <  Less than
  727.   >  Greater than
  728.  
  729. TESTVAL <token1> <relation> <token2> <label>
  730.  
  731.   Perform a numeric comparison and go to <label> if true.
  732.   <token1> and <token2> may be either variables or constants.
  733.   <relation> is the same as for TEST.
  734.  
  735. LINK <script filename>
  736.  
  737.   Chain to a new script file. All old variables are cleared before the new
  738.   script starts executing. It is recommended that your break your scripts
  739.   into small modules and use LINK to jump from one script to another.
  740.   LINK does not clear the global variables, $GLOBAL0 to $GLOBAL29, or any of
  741.   the special read-only variables. NOTE: The script filename should be
  742.   a name of 8 characters or less and not contain an extension.
  743.  
  744. SHELL <text>
  745.  
  746.   Shell to DOS, executing <text> on command.com startup.
  747.   When the shell process is finished, control returns to VBBS and
  748.   the script processor.
  749.  
  750. BREAK <label>
  751.  
  752.   Specifies the label to branch to if Ctrl-C is detected. To turn off
  753.   Ctrl-C checking, issue a BREAK OFF command.
  754.  
  755.                              ==*==
  756.  
  757.                             User Data Commands
  758.                            ~~~~~~~~~~~~~~~~~~~~
  759.  
  760. SETFLAGS <flag> <switch>
  761.  
  762.   These are optional, sysop-defined general purpose flags.
  763.   <flag> is a character from A to Z.  <switch> is ON or OFF.
  764.   When a user logs on, the special variable $FLAGS is automatically loaded.
  765.  
  766. SETEXTRA <extra #> <text>
  767.  
  768.   There are 9 extra 16-character fields for your use.
  769.   <extra #> is 1 to 9. <text> is text to write into the data field.
  770.   When a user logs on, the special variables $EXTRA1 to $EXTRA9
  771.   are automatically loaded. More special variables, loaded at login-time:
  772.  
  773.   $SECURITY - User's security level. 250 and up is considered
  774.               Co-sysop/Sysop access. Use TESTVAL and this variable to
  775.               implement your own security.
  776.   $NAME     - User's real name.
  777.   $TITLE    - SysOp-Defined field.
  778.   $HANDLE   - User's handle.
  779.   $USER     - User's account number.
  780.   $TIMESON  - Number of logons
  781.   $TOTALMIN - Total number of minutes on since account was created.
  782.   $TIMEON   - Number of minutes on for this session.
  783.   $TIMELEFT - Number of minutes left for this session.
  784.   $MAXTIME  - Maximum minutes per day.
  785.   $ANSI     - Contains ON or OFF depending on user's selection of ANSI.
  786.   $PAGE     - Number of lines to print before pause.
  787.  
  788.                                     ==*==
  789.  
  790.                             Miscellaneous Commands
  791.                            ~~~~~~~~~~~~~~~~~~~~~~~~
  792.  
  793. LISTUSERS
  794.  
  795.   Lists out all user accounts.
  796.  
  797. SECURITY
  798.  
  799.   Lists out all user accounts with:
  800.   Security lvl > 150 or non-zero Group Code
  801.  
  802. KILL <filename>
  803.  
  804.   A clean way to delete a file.
  805.  
  806. CHECKFILE <variable> <path/filename>
  807.  
  808.   Stores size of file into variable. If file is non-existant, returns 0.
  809.  
  810. JR <variable> <size>
  811.  
  812.   Right-justify the contents of a variable, padding with spaces.
  813.  
  814. JL <variable> <size>
  815.  
  816.   Left-justify the contents of a variable, padding with spaces.
  817.  
  818. JC <variable> <size>
  819.  
  820.   Center-justify the contents of a variable, padding with spaces.
  821.  
  822. EF <path/filename>
  823.  
  824.   Transmits the contents of the text file.
  825.  
  826. LOG <text>
  827.  
  828.   Write text to the BBS log file, BBS.LOG.
  829.  
  830. LOGOFF
  831.  
  832.   Terminates script execution and logs the user off.
  833.  
  834. LOGOFFYN
  835.  
  836.   Much like LOGOFF, but prompts for confirmation first.
  837.  
  838. BEEP
  839.  
  840.   Beeps the PC speaker. Useful if you want a "Page the SYSOP" feature.
  841.  
  842. ! <comment line>
  843.  
  844.   A ! at the beginning of a line denotes a script comment line.
  845.   These lines are ignored by the VBBS script loader/parser.
  846.  
  847. USEREDIT
  848.  
  849.    The USEREDIT script command lets the sysop do remote user editing.
  850.  
  851. MENU <filename>
  852.  
  853.    Transmits file <filename>.ans is user has ANSI, <filename>.asc otherwise.
  854.  
  855.    If ! is the first character of the line, VBBS interpets this as
  856.    "don't print this line unless the user's security level is greater
  857.    or equal to the immediately preceeding three-digit number."
  858.    Examples:
  859.    !255 S) SysOp Menu  <== Line not printed unless the user has SL >= 255.
  860.    !100 F) Forward     <==  "    "     "      "     "   "    "  "  "  100.
  861.  
  862. ADDKEYS <variable> <keys to add> <min. security level>
  863.  
  864.    Concatenates a string to the variable specified, if the user's
  865.    Security Lebel is greater than or equal to the msl specified.
  866.  
  867. FINDFIRST <variable> <mask to search>
  868.  
  869.    Searches the DOS Directory, for the first file to match the mask
  870.    specified.
  871.  
  872. FINDNEXT <variable>
  873.  
  874.    Finds the next matches after a FINDFIRST. Will return a null string ""
  875.    when the search has ended.
  876.  
  877. NEWPAGE
  878.  
  879.   Resets the "Pause on screen" line counter.
  880.  
  881. PAGESYSOP
  882.  
  883.   Pages the SYSOP BEEPER is Scroll Lock is activated.
  884.  
  885. SLEEP <# of seconds>
  886.  
  887.   Pauses Script Execution for the number of seconds specified.
  888.  
  889. More Commands:
  890. ~~~~~~~~~~~~~~~
  891.  
  892. The DO LOOP:
  893.  
  894.    In this form, the variable loops from start to end.
  895.  
  896.    DO <var> = <start> <end>
  897.       [body of loop]
  898.    LOOP
  899.  
  900.    In this form, DO performs while a specific variable is non-zero.
  901.  
  902.    DO WHILE <var>
  903.      [body of loop]
  904.    LOOP
  905.  
  906. IF-THEN-ELSE-ENDIF:
  907.  
  908.    IF <expr> <relation> <expr> THEN
  909.       [then-code]
  910.    ELSE
  911.       [else-code]
  912.    ENDIF
  913.  
  914.    IF <expr> <relation> <expr> THEN
  915.       [then-code]
  916.    ENDIF
  917.  
  918.    Use IFVAL to test numeric relationships.
  919.    Relations are the same as for TEST and TESTVAL.
  920.  
  921. A few miscellaneous special variables:
  922.   $DATE  - Current system date.
  923.   $TIME  - Current system time.
  924.   $PORT  - Port Number.
  925.   $BAUD  - Baud Rate of Connection.
  926.   $NODE  - Your system's VirtualNET node number as defined by VCONFIG.EXE.
  927.   $BBSNAME  - Name of BBS as defined by VCONFIG.EXE.
  928.   $SYSOP    - Name of SysOp as defined by VCONFIG.EXE.
  929.   $AVAILABLE - SysOp Available. Contains Y or N.
  930.  
  931. A few miscellaneous special constants:
  932.   $CLEAR - Set to Ctrl-L (ascii code 12) when ANSI is OFF, Otherwise set to
  933.            the ANSI clear screen command.
  934.   $CR    - Carriage Return (ascii code 13).
  935.   $LF    - Linefeed        (ascii code 10).
  936.   $BS    - Back Space      (ascii code 8).
  937.   $BELL  - Bell            (ascii code 7).
  938.   $CRLF  - Carriage Return and Linefeed.
  939.  
  940.         =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  941.  
  942.                                The Database
  943.                               ~~~~~~~~~~~~~~
  944.  
  945. The database can be used for a lot of different purposes. You can store
  946. messages, file descriptions, or even messages with attached files.
  947. Also, there is no reason why you can't redefine the fields and use them
  948. for other types of data storage.
  949.  
  950. There are two parts to each database entry; The HEADER INFORMATION, and
  951. the MEMO LINES. Header info is data like sender's name, subject,
  952. addressee, etc. Memo Lines are the actual body of the entry.
  953. They are the message text or long file description, dpending on how you
  954. are using the database.
  955.  
  956. Each database must reside in it's own hard disk sub-directory.
  957. In addition to the file which holds the header info, and the text files
  958. which hold the memo lines, there are two other files. One stores
  959. user quick-scan pointers. The other stores network quick-scan pointers.
  960.  
  961. Using the BUFFER is an integral part of the database system. The BUFFER is
  962. really nothing more than a RAM array of strings which holds work
  963. in-progress. You can use the BUFFER commands to build your own Editor.
  964.  
  965.  
  966.     =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  967.  
  968.                     Compiling Scripts with VCOM.EXE
  969.                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  970.  
  971. VCOM.EXE is the Virtual BBS/NET script language compiler. VCOM expects the
  972. source code file for the script to have a .V extension.
  973.  
  974. During compilation, VCOM generates two files for the script:
  975.  
  976.    .LIT file: The literal data from the source code.
  977.    .COD file: The actual program in numeric integer-coded form.
  978.  
  979. If your script is called MAIN.V, then the command line to compile the
  980. script would be:
  981.  
  982. VCOM MAIN
  983.  
  984. And the compiler will generate MAIN.LIT and MAIN.COD.
  985.  
  986. The compiler will trap any GO, TEST, TESTVAL, CALL, or BREAK commands which
  987. do not have a valid destination label. You will have to fix the error and
  988. compile again. This error message may also appear if there is a syntax error
  989. in the GO/TEST/TESTVAL/CALL/BREAK command line.
  990.  
  991. It will also trap any attempt to use duplicate line labels.
  992.  
  993. Include Files Compiler Directive
  994.  
  995. Also, you may "include" other .V files in the compilation of your scripts.
  996. That way, you can write a common routine once, and use it with other script
  997. modules without the need to type (or cut/paste) the code into the modules
  998. by hand. The include directive is & and it must be the first character
  999. on the line. It must be followed by a space, and then the filename of
  1000. the file to include. Example:
  1001. & editor.v
  1002.  
  1003.                          -=-=-=-=-=-=-=-=-=-=-=-=-=-
  1004.  
  1005.     For further discussion of Vscripts and access to modifications,
  1006. modified and additional Vscripts, please join us on the VirtualNET
  1007. Vscripts sub board and the VirtualNET networked Vscripts and Source Mods
  1008. Networked File listings.
  1009.  
  1010.